tisdag 9 maj 2017

Signs of life, or something

Sounds like silence

The silence on the blog should not be taken as sign of abandonment. Work has been simmering slowly the last few months, however my actual paid work, and other stuff have taken most of my time.
The activity on the blog should not be taken as a sign of great achievements, however. I've been working on OpenJDK 8 lately, and before getting to a point of actually having something to run and test, there's quite a few things that need to be in place. I'm using IcedTea 8, an official OpenJDK project which, and I quote, "aims to make it easier for users to build and deploy OpenJDK". It's basically a set of files which uses the official OpenJDK code base, but sligthly alters it, and adjusts the build process, so it's possible to, for instance, use JamVM instead of HotSpot, do cross compiles, and tweak the JDK in other ways.

Now I've gotten to the point where all autoconf, makefiles, et.c., can generate a cross compiling environment for PPC 32 bit AmigaOS, and I can just do make, and find what's missing as I go along. The stuff missing is Amiga-specific Java classes for AmigaOS stuff, for instance the Java class java/io/AmigaFileSystem.java, which then also needs some native stuff in java/io/AmigaFileSystem_md.c that connects down to real AmigaOS code. When finding something missing, I usually glance at the Windows or Solaris OpenJDK code, try to understand what it does, copy either implementation, and alter it to fit AmigaOS. Sometimes I can also re-use old GNU Classpath code and tweak it to fit the OpenJDK world. All in all, I'm kind of the Amiga-Java Dr. Frankenstein, trying to bring what pieces I have together. Now, I should also say that its not all copy-and-paste, I do actually write some of my own code. You can't find this on stackoverflow, ya know!


It compiles!

I mentioned cross-compile above, meaning that I'm on my Linux machine doing most of my work. Which is kind of boring, because I really miss AmigaOS, and Cubic IDE. At times I've been working in AmigaOS, and constantly checking in the code to Subversion, and checking it out in Linux and building it there. Somewhat cumbersome, but it sort of works. I've tried various FTP syncing solutions, but the SVN solution has the advantage that I regularly check in the code!

söndag 17 april 2016

Boys keep swinging

When running the Swing applicaiton Jaguar, the AmigaGuide reader, I got exceptions due to some missing font stuff.

Light vs. heavy

When opening a Swing GUI, Swing draws all the interface components, buttons, lists, text input strings, etc, on its own. So on each platform, be it Windows, MacOS or AmigaOS, a Swing GUI would look the same. This can be compared to AWT where all the buttons are drawn by the operating system, meaning that an AWT application looks like a Windows application on Windows, and an AmigaOS application on AmigaOS. This should mean that implementing Swing requires less coding for each new platform -- if a platform can draw lines and boxes, it can also draw Swing applications, whereas to support AWT, someone would have to map each AWT button to, in our case, an intuition button. And repeat this for radio buttons, tabs, lists, text input string, etc. Usually Swing components are defined as a lightweight, and AWT componenets are heavyweight.

In GNU Classpath there exists implementations for the Swing stuff for various backends, such as GTK, X and QT. The font exception I got for Swing, is due to the Amiga implementation currently only returning "null" for some of these things. And, since Swing has to draw everything on its own, it also has to know what a font looks like. In the GTK/X/QT implementations this is handled by calling each frameworks native methods for that stuff (this is stuff like how many pixels wide the font is, where the baseline is, etc.). There is however a non-native font implementation in GNU Classpath called OpenTypeFont. This implementation actually reads the entire font file, and calculates the different font metrics in Java -- meaning I don't have to create native calls down to Amiga's font handling stuff (bullet.library, diskfont.library, etc), but instead rely on the Java implementation to read the TrueType fonts we usually have in Fonts:_ttf/.
Now, the OpenTypeFont implementation uses something called MappedByteBuffer's. A MappedByteBuffer is like a normal buffer of bytes, however backed by an actual file. The advantage of a MappedByteBuffer is that we can open a file, map it to memory, and pretend that we've read the entire file into memory, although we actually haven't. When the Java application reads a byte from the buffer, the underlying operating system will make sure that stuff is read from the file. Font files can be pretty large, so that's motivation behind using MappedByteBuffer's in this case -- we don't have to put the entire file in memory.

In order to implement MappedByteBuffer's, the Unix/Linux/Windows implementation uses mmap(), which does exactly what we want -- map a file to memory. There is an AmigaOS 4 equivalent in exec.library, the MMU interface called MapMemory. This is however:

       extremely dangerous to use if you don't know what
       you're doing. And since the virtual addressing architecture is
       not publically documented, you do *NOT* know what you're doing.
       If in doubt, don't use this function, and rely on ExecSG to do the job.

Hmpf.

Anyhow, with some helpful pointers from fellow amigans at support.amigaos.net, I've actually gotten some sort of mapped byte buffer implementation in place. I'm currently simply reading the entire file into memory, and then I just reat like an ordinary byte buffer. So I've basically removed all the perks of the MappedByteBuffer. But now atleast the OpenTypeFont implementation happily reads the fonts!
But, of course, this isn't enough. When I run the Jaguar application, a windows do open, but it's oh so empty. I'm not very surprised, since the Swing implementation on Amiga isn't done. One could illustrate it like a painter standing with a brush, eagerly waving in the air, with no paint on the brush, and no canvas in sight.

Either way, I, like the boys, keep swinging.


lördag 19 mars 2016

Swing it, magistern!

Finally motivated by some inquiring posts on amigans.net, and a donation, I've found some time to continue my Jamiga works. I'm now focusing on AWT/Swing. So, swing it magistern!

This is Alice Babs, Sweden's (late) most famous be-bop-a-doodelidoo-scat singer. She swings it good.

I've setup a Trello board, mostly for my own peronsal use. I've found that given my sometimes rather long pauses, I tend to forget what I've done. So I'm trying this Trello out, where I'll create cards under "Doing" for the tasks I'm currently doing, and adding what else I might come up with under "To do". Hopefully I'll be able to keep it updated.
If you register for Trello, I think its possible to comment and vote and stuff.

Currently there are two cards under "doing": "Fix current AWT/Swing implementation", and "Fix IntuiFontPeer". The latter being more exactly what I'm doing, and the former being the greate context why I'm doing the latter. In the "done" department we have "Find Swing/AWT application to run", which is done. The result was the oh so exciting Swing application "Jaguar". Jaguar is a Java AmigaGuide reader, using Swing.

Screenshot from Linux.
Hardly the killer app AmigaOS needs, but it starts, and has a GUI. Written in 1998 it uses the deprecated imports "com.sun.java.swing", instead of "newer" "javax.swing". After a quick find & replace, Jaguar could be compiled and run with JAmiga. It does however, of course, throw errors and can't actually be run. But that's what the Trello cards are about. (One more thing to note about Jaguar is that it can't be used, since there's a few exception when clicking the AmigaGuide buttons... but that's really just a minor detail. After all we have MultiView.)

fredag 30 oktober 2015

Mind sweeped

Today I'm playing a game of Minesweep. I never really got the hang of that game, but I'm hoping that one day we might be able play some more intriguing games. On the Amiga, using JAmiga!

So, yes, I've finally managed to get the existing AWT functionality working! Much of this is not my code, but created like ten years ago (!) by the original JAmiga developer, Peter Werno. There were a few issues that kept it from running using the new JamVM, and otherwise updated code, but I've finally got the original demos to work.

Volatile

There were a few synchronization issues, which didn't happen before. One minor, easy quick fix, was to add the word "transient", I mean "volatile" to the running flag of the window listener thread. This is how it works: the main Java thread wants to open a window. Then a new "window listener" thread is started, which actually opens the window. In order for the main thread to know when the window has been opened, it polls and loops for a flag to be set to true by the window listener thread.

// main thread waits for(ever) for running to be true 
MainThread::startGUI() {
   new WindowListenerThread().openWindow();
   while(running == false) {
     // do nothing
   }
}

...
// window listener notifies "object" when opened
WindowListenerThread::openWindow() {
   window.open();
   running = true;
}

In the old code, this was a normal boolean flag, not marked with special word "volatile". "Volatile" means that the variable can be changed by more than one thread, and, if you don't mark it that way, the JVM can make clever assumptions if it thinks that this variable isn't going to change. This means that if the main thread keeps looping and looking at it, the flag will, most of the times, be false. Even though it will take like no time to open that window, the loop will probably have made quite a few loops, and thus, in order to optimize and get a snappier Java experience, instead of actually fetching the value of the flag each time, the JVM assumes it is always false. And this is all according to the specifications and the way Java works. Previously the JVM didn't make this clever assumption (or if it was the old Java compiler that didn't make them).

I also added some synchronization around these parts, so instead of a constant loop, the loop is synchronized, meaning it checks the flag, and then waits to be notified from the window listener thread, and only then checks the flag.

// main thread waits for "object" to be notified
MainThread::startGUI() {
   new WindowListenerThread().openWindow();
   while(running == false) {
      object.wait();
   }
}

...

// window listener notifies "object" when opened
WindowListenerThread::openWindow() {
   window.open();
   running = true;
   object.notify();
}

This synchronization (the notify() and wait() methods) are part of the Java standard, and used all over the place. And when looking at it for the AWT stuff, I found some things in my implementation that were not quite working. I've known that the synchronization and signalling parts have had some glitches, so that signals sometimes aren't received as they should, leading the JVM to a halt. I knew I was taking a few shortcuts before, but now I'm pretty confident it works according to specification, since I this time actually carefully read the specifications... And, I've also been able to verify that it seems to work better, since I actually now use JAmiga to compile Java code when I'm developing JAmiga on my X1000. We kind of almost have a Java implementation so we can build Java ourselves on the Amiga!
Edited: of course I meant volatile, not transient

So, all the graphics is done now?

Now, this doens't mean that the graphics are all done, and that we can download NetBeans and run it. There's still quite a few unimplemented methods in the JAmiga specific AWT-packages. But it's getting there!

onsdag 7 oktober 2015

Software Freedom Day!

Saturday the 19th september I travelled to Uppsala, on Software Freedom Day, where Uppsala Linux User Group had an event. I was invited to talk about Jamiga: Java on Amiga.

You can see it below. It's in Swedish, but there are subtitles in English.

A big thanks to ULUG and Josef Andersson for inviting me, and special kudos to Joel Edberg for filming and doing the editing!

Besides me babbling about JAmiga, there were also talks on how open source software is used at SVT (the Swedish public service television), a talk about Gnome and a series of interviews on how open source products are used at various Swedish startups. Very interesting stuff indeed! Also, not to forget the beer and wine at a local pub afterwards. Nice to meet some Amiga folks IRL.

lördag 21 mars 2015

Interesting platform, but missing implementation here

In my last blog entry (which was ages ago, I know!), I bragged about my OpenJDK efforts. Or bragged is perhaps not the word, but, I mentioned it. I sadly haven't had time to do much about OpenJDK lately, or my Amiga for that matter. But now things at work, and in my new house (yay!) are starting to go back to normal, giving me some time to tinker with JAmiga and OpenJDK.

And this is what I'm currently greeted with:

"Interesting platform, but missing implementation here". Ha! If they only knew...

Interesting platform

My AmigaOne X1000 is currently abroad for a physical check-up, but meanwhile I've been busy with my Ubuntu laptop. I managed to compile a working adtools setup with the help of salass00 guide excellent guida at os4coding.net. It wasn't that hard to do, if you just follow the instructions. However, the GCC version currently in trunk cannot be built (March 2015), so you should instead use the 4.9.x tag. At step 5, "Build and install gcc", you have to alter "gcc-build/Makefile" which points to "gcc-trunk", and "trunk", and change this to "gcc-4.9.x" and "4.9.x", respectively. And you must have checked out the 4.9.x branch from SVN.

With the adtools cross-compiler suite up and running, I've begun my porting efforts. I've done this before, both trying the IcedTea OpenJDK project, and vanilla OpenJDK 7 and 8. My current focus is however on OpenJDK 9, without any iced tea -- just regular coffee (currently mostly decaf though, or perhaps just disgusting brown water). OpenJDK isn't released or done yet. If I understand the OpenJDK procedures correctly, each big version (i.e. 9), has a number of sub projects working on different aspects of OpenJDK. The project "Jigsaw" is my aim at the moment. I've talked about Jigsaw previously, referring to it as an onion, in short it aims to modularise OpenJDK. My hope is that I'll initially will get away with just porting the "java base" stuff, and then iteratively proceeding with the rest of Java. For the GNU classpath this is already possible, with its different libraries for javalang, javanet, and so on. OpenJDK in essence only has one big java-library. It is possible to disable stuff like AWT and such in OpenJDK, but in order to skip f.i. the java-net stuff, I would have to write dummy functions in order to make it compile. But with Jigsaw, the idea is to be able to disable entire modules, where java-net is one.

Missing implementation

Now, going back to the error message above. I know the reason for it, and I sort of knows what's needed. And its quite a lot. The error relates to "hotspot", which is OpenJDK's virtual machine -- where I want to use "JamVM". So, I can either try to implement support for hotspot, or try and adapt the build process to skip hotspot. It is possible to build OpenJDK without hotspot, if you use IcedTea. But IcedTea currently only supports OpenJDK 8. And, IcedTea needs some adaptation to support AmigaOS as well. So I think I'm doing the right thing going for OpenJDK 9. Hopefully.

lördag 28 juni 2014

Amiga+OpenJDK

In today's picture you can actually see AmigaOS running OpenJDK! Well, at least starting it.

The error you see in the grab is due to missing native libraries. What you actualy see is the latest version of JamVM starting, using OpenJDK 9 class files -- there's no Amiga specific code in there yet.

My next step is ofcourse to compile an OpenJDK version of java.library. I've begun the process on an Ubuntu installation with a PowerPC cross-compiler. I'll probably try to move the current JAmiga native library "framework" into the OpenJDK build process, and then iteratively move, refactor and adapt the current GNU Classpath Amiga implementation. It sounds straight forward enough, but its going to take a while.

But its a start.

lördag 24 maj 2014

More mauve

Mauving forward (I've already used that pun, I know)

I'm still looking through the mauve test suite, and this is my current report. For java.io tests you can see previous post.

Not very existing results, but I just wanted to give a status report. Besides trying to fix the errors, I'm also more actively looking into OpenJDK, currently erstablishing a build environment for it on, and for, Linux, i.e. no Amiga-specific code yet. My plan is to make jamvm use OpenJDK, get some sort of empty native Jamiga library working, so I can get it to complain about missing native methods. And then take it from there. Currently it looks like I'll be able to re-use much of my current code.

java.util: 182/228 tests passed

Passed java.util tests

TEST PASSED (2 checks) java.util.logging.SocketHandler.SocketHandler
TEST PASSED (1 checks) java.util.logging.SocketHandler.getFormatter
TEST PASSED (1 checks) java.util.logging.SocketHandler.getFilter
TEST PASSED (2 checks) java.util.logging.LogRecord.setSourceClassName
TEST PASSED (4 checks) java.util.logging.LogRecord.setLoggerName
TEST PASSED (3 checks) java.util.logging.LogRecord.setParameters
TEST PASSED (2 checks) java.util.logging.LogRecord.getThreadID
TEST PASSED (2 checks) java.util.logging.LogRecord.setSourceMethodName
TEST PASSED (3 checks) java.util.logging.LogRecord.setSequenceNumber
TEST PASSED (1 checks) java.util.logging.LogRecord.getMillis
TEST PASSED (2 checks) java.util.logging.LogRecord.setThreadID
TEST PASSED (4 checks) java.util.logging.LogRecord.setMessage
TEST PASSED (2 checks) java.util.logging.LogRecord.setLevel
TEST PASSED (3 checks) java.util.logging.LogRecord.setThrown
TEST PASSED (2 checks) java.util.logging.LogRecord.setMillis
TEST PASSED (3 checks) java.util.logging.LogRecord.setResourceBundle
TEST PASSED (2 checks) java.util.logging.XMLFormatter.getTail
TEST PASSED (3 checks) java.util.logging.XMLFormatter.getHead
TEST PASSED (6 checks) java.util.logging.XMLFormatter.formatMessage
TEST PASSED (3 checks) java.util.Collections.reverseOrder
TEST PASSED (10 checks) java.util.Collections.unmodifiableMap
TEST PASSED (10 checks) java.util.Collections.fill
TEST PASSED (35 checks) java.util.Collections.sort
TEST PASSED (4 checks) java.util.Collections.rotate
TEST PASSED (4 checks) java.util.Collections.min
TEST PASSED (4 checks) java.util.Collections.reverse
TEST PASSED (4 checks) java.util.Collections.max
TEST PASSED (9 checks) java.util.Collections.copy
TEST PASSED (19 checks) java.util.Collections.unmodifiableList
TEST PASSED (104 checks) java.util.Collections.binarySearch
TEST PASSED (12 checks) java.util.AbstractSet.AcuniaAbstractSetTest
TEST PASSED (2 checks) java.util.SimpleTimeZone.setRawOffset
TEST PASSED (4 checks) java.util.SimpleTimeZone.setStartYear
TEST PASSED (4 checks) java.util.SimpleTimeZone.hashCode
TEST PASSED (6 checks) java.util.SimpleTimeZone.getOffset
TEST PASSED (1 checks) java.util.SimpleTimeZone.clone
TEST PASSED (12 checks) java.util.SimpleTimeZone.check14
TEST PASSED (42 checks) java.util.SimpleTimeZone.constructors
TEST PASSED (3 checks) java.util.SimpleTimeZone.constants
TEST PASSED (1 checks) java.util.SimpleTimeZone.getRawOffset
TEST PASSED (2 checks) java.util.SimpleTimeZone.setDSTSavings
TEST PASSED (32 checks) java.util.SimpleTimeZone.inDaylightTime
TEST PASSED (35 checks) java.util.Stack.AcuniaStackTest
TEST PASSED (387 checks) java.util.Hashtable.AcuniaHashtableTest
TEST PASSED (4 checks) java.util.Hashtable.ContainsHash
TEST PASSED (2 checks) java.util.Hashtable.NullValue
TEST PASSED (4 checks) java.util.Hashtable.EnumerateAndModify
TEST PASSED (5 checks) java.util.Hashtable.HashContains
TEST PASSED (12 checks) java.util.Hashtable.basic
TEST PASSED (244 checks) java.util.regex.PatternSplit
TEST PASSED (2082 checks) java.util.regex.CharacterClasses
TEST PASSED (30 checks) java.util.regex.Pattern.matches
TEST PASSED (8 checks) java.util.logging.LogManager.readConfiguration
TEST PASSED (3 checks) java.util.logging.LoggingMXBean.Test
TEST PASSED (8 checks) java.util.logging.Handler.setEncoding
TEST PASSED (1 checks) java.util.logging.Handler.isLoggable
TEST PASSED (4 checks) java.util.logging.Handler.setFilter
TEST PASSED (4 checks) java.util.logging.Handler.setErrorManager
TEST PASSED (3 checks) java.util.logging.Handler.getErrorManager
TEST PASSED (4 checks) java.util.logging.Handler.setLevel
TEST PASSED (12 checks) java.util.logging.Handler.reportError
TEST PASSED (2 checks) java.util.logging.Level.hashCode
TEST PASSED (9 checks) java.util.logging.Level.getName
TEST PASSED (29 checks) java.util.logging.Level.parse
TEST PASSED (9 checks) java.util.logging.Level.intValue
TEST PASSED (7 checks) java.util.logging.Level.equals
TEST PASSED (9 checks) java.util.logging.Level.toString
TEST PASSED (8 checks) java.util.logging.Logger.getParent
TEST PASSED (10 checks) java.util.logging.Logger.getAnonymousLogger
TEST PASSED (1 checks) java.util.logging.Logger.getName
TEST PASSED (0 checks) java.util.logging.Logger.PR35974
TEST PASSED (11 checks) java.util.logging.Logger.hierarchyChecks
TEST PASSED (2082 checks) java.util.regex.CharacterClasses
TEST PASSED (30 checks) java.util.regex.Pattern.matches
TEST PASSED (499 checks) java.util.regex.Pattern.pcrematches
TEST PASSED (50 checks) java.util.regex.Pattern.UnicodeSimpleCategory
TEST PASSED (60 checks) java.util.regex.Matcher.hitEnd
TEST PASSED (5 checks) java.util.regex.Matcher.Regions
TEST PASSED (374 checks) java.util.LinkedHashMap.LinkedHashMapTest
TEST PASSED (1 checks) java.util.LinkedHashMap.Regress
TEST PASSED (3 checks) java.util.TimeZone.setID
TEST PASSED (2 checks) java.util.TimeZone.setDefault
TEST PASSED (0 checks) java.util.TimeZone.zdump
TEST PASSED (36 checks) java.util.ArrayList.subList
TEST PASSED (60 checks) java.util.TreeSet.basic
TEST PASSED (5 checks) java.util.jar.JarInputStream.getNextEntry
TEST PASSED (36 checks) java.util.LinkedList.subList
TEST PASSED (4 checks) java.util.LinkedList.SubListTest
TEST PASSED (216 checks) java.util.LinkedList.AcuniaLinkedListTest
TEST PASSED (1 checks) java.util.AbstractCollection.AcuniaAddCollectionTest
TEST PASSED (63 checks) java.util.AbstractCollection.AcuniaAbstractCollectionTest
TEST PASSED (14 checks) java.util.AbstractCollection.toString
TEST PASSED (6 checks) java.util.Currency.getInstance
TEST PASSED (4 checks) java.util.Currency.Taiwan
TEST PASSED (4 checks) java.util.Currency.CanadaFrench
TEST PASSED (4 checks) java.util.Currency.Korea
TEST PASSED (4 checks) java.util.Currency.Germany
TEST PASSED (3 checks) java.util.Currency.Constructors
TEST PASSED (4 checks) java.util.Currency.PRC
TEST PASSED (4 checks) java.util.Currency.China
TEST PASSED (4 checks) java.util.Currency.France
TEST PASSED (2 checks) java.util.Currency.ReferenceEquality
TEST PASSED (4 checks) java.util.Currency.Canada
TEST PASSED (4 checks) java.util.Currency.Japan
TEST PASSED (4 checks) java.util.Currency.UK
TEST PASSED (10 checks) java.util.Calendar.getInstance
TEST PASSED (5 checks) java.util.Calendar.simple
TEST PASSED (7 checks) java.util.Calendar.roll
TEST PASSED (22 checks) java.util.Calendar.add
TEST PASSED (1 checks) java.util.Calendar.TimeZone
TEST PASSED (2 checks) java.util.Calendar.setTime
TEST PASSED (10 checks) java.util.Calendar.minmax
TEST PASSED (12 checks) java.util.Calendar.ampm
TEST PASSED (1 checks) java.util.Calendar.setTimeZone
TEST PASSED (36 checks) java.util.Vector.subList
TEST PASSED (2 checks) java.util.Vector.retainAll
TEST PASSED (2 checks) java.util.Vector.removeAll
TEST PASSED (386 checks) java.util.Vector.AcuniaVectorTest
TEST PASSED (11 checks) java.util.Vector.copyInto
TEST PASSED (94 checks) java.util.AbstractMap.AcuniaAbstractMapTest
TEST PASSED (1 checks) java.util.zip.GZIPInputStream.PR24461
TEST PASSED (1 checks) java.util.zip.ZipEntry.time
TEST PASSED (4 checks) java.util.zip.ZipEntry.setComment
TEST PASSED (7 checks) java.util.zip.ZipEntry.Size
TEST PASSED (2 checks) java.util.zip.ZipEntry.newZipEntry
TEST PASSED (3 checks) java.util.zip.ZipInputStream.close
TEST PASSED (7 checks) java.util.zip.ZipInputStream.basic
TEST PASSED (10 checks) java.util.zip.InflaterInputStream.basic
TEST PASSED (1 checks) java.util.zip.ZipFile.NoEntryTest
TEST PASSED (2 checks) java.util.zip.ZipFile.DirEntryTest
TEST PASSED (160 checks) java.util.zip.Adler32.checksum
TEST PASSED (21 checks) java.util.Random.basic
TEST PASSED (28 checks) java.util.Date.compareTo
TEST PASSED (6 checks) java.util.Date.getTimezoneOffset
TEST PASSED (10 checks) java.util.Date.before
TEST PASSED (10 checks) java.util.Date.after
TEST PASSED (10 checks) java.util.Date.range
TEST PASSED (3 checks) java.util.Date.clone
TEST PASSED (25 checks) java.util.Date.parse
TEST PASSED (4 checks) java.util.Date.equals
TEST PASSED (99 checks) java.util.Arrays.fill
TEST PASSED (139 checks) java.util.Arrays.sort
TEST PASSED (13 checks) java.util.Arrays.asList
TEST PASSED (56 checks) java.util.Arrays.equals
TEST PASSED (67 checks) java.util.Arrays.binarySearch
TEST PASSED (3 checks) java.util.EnumSet.ComplementOf
TEST PASSED (29 checks) java.util.Iterator.ConcurrentModification
TEST PASSED (24 checks) java.util.concurrent.CopyOnWriteArrayList.AddAllTest
TEST PASSED (4 checks) java.util.concurrent.CopyOnWriteArrayList.RemoveAllTest
TEST PASSED (57 checks) java.util.concurrent.CopyOnWriteArrayList.TestIterators
TEST PASSED (6 checks) java.util.concurrent.CopyOnWriteArrayList.RetainAllTest
TEST PASSED (5 checks) java.util.concurrent.CopyOnWriteArrayList.Equals
TEST PASSED (22 checks) java.util.concurrent.CopyOnWriteArrayList.Clone
TEST PASSED (21 checks) java.util.concurrent.CopyOnWriteArrayList.AddAllAbsentTest
TEST PASSED (35 checks) java.util.concurrent.CopyOnWriteArrayList.SubListTest
TEST PASSED (16 checks) java.util.concurrent.CopyOnWriteArrayList.RemoveTest
TEST PASSED (66 checks) java.util.Collection.Test
TEST PASSED (105 checks) java.util.AbstractSequentialList.AcuniaAbstractSequentialListTest
TEST PASSED (76 checks) java.util.BitSet.AcuniaBitSetTest
TEST PASSED (10 checks) java.util.BitSet.clear
TEST PASSED (22 checks) java.util.BitSet.get
TEST PASSED (9 checks) java.util.BitSet.flip
TEST PASSED (32 checks) java.util.BitSet.jdk10
TEST PASSED (1 checks) java.util.Scanner.FindWithinHorizon
TEST PASSED (21 checks) java.util.Scanner.Radix
TEST PASSED (17 checks) java.util.Scanner.FishString
TEST PASSED (6 checks) java.util.Scanner.MultiLine
TEST PASSED (8 checks) java.util.StringTokenizer.nextElement
TEST PASSED (4 checks) java.util.StringTokenizer.hasMoreElements
TEST PASSED (4 checks) java.util.StringTokenizer.hasMoreTokens
TEST PASSED (12 checks) java.util.StringTokenizer.nextToken
TEST PASSED (31 checks) java.util.StringTokenizer.constructors
TEST PASSED (4 checks) java.util.StringTokenizer.countTokens
TEST PASSED (3 checks) java.util.Timer.taskException
TEST PASSED (1 checks) java.util.Observable.observable
TEST PASSED (3 checks) java.util.Properties.getProperty
TEST PASSED (21 checks) java.util.Properties.load
TEST PASSED (295 checks) java.util.HashMap.AcuniaHashMapTest
TEST PASSED (108 checks) java.util.AbstractList.AcuniaAbstractListTest
TEST PASSED (124 checks) java.util.GregorianCalendar.setFirstDayOfWeek
TEST PASSED (4 checks) java.util.GregorianCalendar.getMinimum
TEST PASSED (258 checks) java.util.GregorianCalendar.conversion

Failed java.util tests

TEST FAILED: 1 of 9 checks failed java.util.logging.Logger.getLogger
TEST FAILED: exception when loading java.util.logging.Logger.TestLogger
TEST FAILED: 3 of 5 checks failed java.util.logging.SocketHandler.publish
TEST FAILED: uncaught exception java.util.Collections.nCopies
TEST FAILED: 2 of 23 checks failed java.util.SimpleTimeZone.check12
TEST FAILED: 1 of 22 checks failed java.util.SimpleTimeZone.hasSameRules
TEST FAILED: 1 of 2 checks failed java.util.SimpleTimeZone.getDSTSavings
TEST FAILED: 1 of 24 checks failed java.util.SimpleTimeZone.equals
TEST FAILED: exception when loading java.util.regex.TestHelper
TEST FAILED: exception when loading java.util.logging.Level.TestUtils
TEST FAILED: 2 of 40 checks failed java.util.logging.Logger.securityChecks
TEST FAILED: exception when loading java.util.regex.TestHelper
TEST FAILED: 3 of 4 checks failed java.util.TimeZone.GetDisplayName
TEST FAILED: 1 of 1 checks failed java.util.ArrayList.serial
TEST FAILED: 2 of 163 checks failed java.util.ArrayList.AcuniaArrayListTest
TEST FAILED: uncaught exception java.util.ResourceBundle.getBundle
TEST FAILED: uncaught exception java.util.TreeMap.serialization
TEST FAILED: 1 of 2 checks failed java.util.jar.JarFile.TestOfManifest
TEST FAILED: 1 of 1 checks failed java.util.jar.JarFile.basic
TEST FAILED: 1 of 4 checks failed java.util.Currency.Italy
TEST FAILED: 1 of 5 checks failed java.util.Currency.US
TEST FAILED: 3 of 27 checks failed java.util.Calendar.dstOffset
TEST FAILED: 2 of 36 checks failed java.util.Calendar.set
TEST FAILED: 1 of 1 checks failed java.util.Vector.VectorSerialization
TEST FAILED: exception when loading java.util.AbstractMap.EIterator
TEST FAILED: exception when loading java.util.AbstractMap.Entry
TEST FAILED: exception when loading java.util.AbstractMap.ESet
TEST FAILED: uncaught exception java.util.zip.Deflater.PR27435
TEST FAILED: 1 of 2 checks failed java.util.zip.GZIPInputStream.basic
TEST FAILED: 1 of 1 checks failed java.util.zip.ZipFile.newZipFile
TEST FAILED: uncaught exception java.util.Date.serialization
TEST FAILED: exception when loading java.util.EnumSet.Colour
TEST FAILED: uncaught exception java.util.prefs.PreferenceTest
TEST FAILED: 3 of 4 checks failed java.util.Scanner.SkipPattern
TEST FAILED: 3 of 3 checks failed java.util.Scanner.FindPattern
TEST FAILED: 1 of 1 checks failed java.util.Scanner.LotsOfPMLong
TEST FAILED: 1 of 1 checks failed java.util.Scanner.LotsOfInts
TEST FAILED: 1 of 101 checks failed java.util.Scanner.Booleans
TEST FAILED: 1 of 1 checks failed java.util.Scanner.Inputs
TEST FAILED: 1 of 1 checks failed java.util.Scanner.FileInput
TEST FAILED: 1 of 1 checks failed java.util.Scanner.LotsOfPMShort
TEST FAILED: 1 of 1 checks failed java.util.Scanner.LotsOfPMInts
TEST FAILED: 1 of 20 checks failed java.util.Scanner.DoubleFloat
TEST FAILED: 1 of 1 checks failed java.util.Scanner.BigDecimalInteger
TEST FAILED: 5 of 87 checks failed java.util.Properties.AcuniaPropertiesTest
TEST FAILED: 1 of 2 checks failed java.util.GregorianCalendar.getMinimalDaysInFirstWeek

java.text: 91/112 tests passed

Passed java.text tests

TEST PASSED (1 checks) java.text.Annotation.Test
TEST PASSED (6 checks) java.text.AttributedCharacterIterator.getRunStart
TEST PASSED (1 checks) java.text.AttributedCharacterIterator.implement
TEST PASSED (46 checks) java.text.AttributedCharacterIterator.getRunLimit
TEST PASSED (3 checks) java.text.AttributedCharacterIterator.getAttribute
TEST PASSED (3 checks) java.text.AttributedCharacterIterator.Attribute.toString
TEST PASSED (4 checks) java.text.ParsePosition.Test
TEST PASSED (8 checks) java.text.Bidi.Basic
TEST PASSED (4 checks) java.text.Bidi.reorderVisually
TEST PASSED (2 checks) java.text.DecimalFormat.hashCode
TEST PASSED (15 checks) java.text.DecimalFormat.applyPattern
TEST PASSED (1 checks) java.text.DecimalFormat.getGroupingSize
TEST PASSED (6 checks) java.text.DecimalFormat.position
TEST PASSED (1 checks) java.text.DecimalFormat.setMultiplier
TEST PASSED (3 checks) java.text.DecimalFormat.setCurrency
TEST PASSED (2 checks) java.text.DecimalFormat.setNegativePrefix
TEST PASSED (3 checks) java.text.DecimalFormat.formatToCharacterIterator
TEST PASSED (2 checks) java.text.DecimalFormat.getDecimalFormatSymbols
TEST PASSED (2 checks) java.text.DecimalFormat.setDecimalSeparatorAlwaysShown
TEST PASSED (1 checks) java.text.DecimalFormat.getPositiveSuffix
TEST PASSED (2 checks) java.text.DecimalFormat.clone
TEST PASSED (1 checks) java.text.DecimalFormat.getNegativeSuffix
TEST PASSED (1 checks) java.text.DecimalFormat.PR27311
TEST PASSED (2 checks) java.text.DecimalFormat.setNegativeSuffix
TEST PASSED (3 checks) java.text.DecimalFormat.PR23996
TEST PASSED (4 checks) java.text.DecimalFormat.setGroupingSize
TEST PASSED (6 checks) java.text.DecimalFormat.toPattern
TEST PASSED (2 checks) java.text.DecimalFormat.isDecimalSeparatorAlwaysShown
TEST PASSED (71 checks) java.text.DecimalFormat.parse
TEST PASSED (2 checks) java.text.DecimalFormat.applyLocalizedPattern
TEST PASSED (14 checks) java.text.DecimalFormat.constructors
TEST PASSED (31 checks) java.text.DecimalFormat.equals
TEST PASSED (2 checks) java.text.DecimalFormat.getPositivePrefix
TEST PASSED (2 checks) java.text.DecimalFormat.setPositivePrefix
TEST PASSED (2 checks) java.text.DecimalFormat.setPositiveSuffix
TEST PASSED (1 checks) java.text.DecimalFormat.getNegativePrefix
TEST PASSED (1 checks) java.text.DecimalFormat.getMultiplier
TEST PASSED (1 checks) java.text.DecimalFormat.getCurrency
TEST PASSED (12 checks) java.text.AttributedString.addAttribute
TEST PASSED (24 checks) java.text.AttributedString.constructors
TEST PASSED (5 checks) java.text.AttributedString.Test
TEST PASSED (30 checks) java.text.AttributedString.getIterator
TEST PASSED (10 checks) java.text.AttributedString.addAttributes
TEST PASSED (2 checks) java.text.NumberFormat.PR31895
TEST PASSED (9 checks) java.text.FieldPosition.Test
TEST PASSED (4 checks) java.text.ACIAttribute.Test
TEST PASSED (1 checks) java.text.ParseException.Test
TEST PASSED (5 checks) java.text.CollationElementIterator.offset
TEST PASSED (356 checks) java.text.CollationElementIterator.jdk11
TEST PASSED (26 checks) java.text.MessageFormat.format14
TEST PASSED (19 checks) java.text.MessageFormat.format
TEST PASSED (11 checks) java.text.MessageFormat.parse
TEST PASSED (1 checks) java.text.DateFormatSymbols.setEras
TEST PASSED (1 checks) java.text.DateFormatSymbols.setMonths
TEST PASSED (1 checks) java.text.DateFormatSymbols.setZoneStrings
TEST PASSED (1 checks) java.text.DateFormatSymbols.setShortMonths
TEST PASSED (1 checks) java.text.DateFormatSymbols.setWeekdays
TEST PASSED (1 checks) java.text.DateFormatSymbols.setShortWeekdays
TEST PASSED (1 checks) java.text.DateFormatSymbols.setAmPmStrings
TEST PASSED (2 checks) java.text.DateFormat.hashCode
TEST PASSED (32 checks) java.text.DateFormat.Test
TEST PASSED (5 checks) java.text.RuleBasedCollator.VeryBasic
TEST PASSED (242 checks) java.text.RuleBasedCollator.jdk11
TEST PASSED (25 checks) java.text.StringCharacterIterator.constructor
TEST PASSED (25 checks) java.text.StringCharacterIterator.iter
TEST PASSED (1 checks) java.text.CharacterIterator.implement
TEST PASSED (2 checks) java.text.SimpleDateFormat.getDateFormatSymbols
TEST PASSED (3 checks) java.text.SimpleDateFormat.applyPattern
TEST PASSED (66 checks) java.text.SimpleDateFormat.attribute
TEST PASSED (3 checks) java.text.SimpleDateFormat.setDateFormatSymbols
TEST PASSED (1 checks) java.text.SimpleDateFormat.getAndSet2DigitYearStart
TEST PASSED (2 checks) java.text.SimpleDateFormat.toPattern
TEST PASSED (10 checks) java.text.SimpleDateFormat.constructors
TEST PASSED (7 checks) java.text.SimpleDateFormat.equals
TEST PASSED (9 checks) java.text.SimpleDateFormat.Test
TEST PASSED (2 checks) java.text.SimpleDateFormat.Cloning
TEST PASSED (0 checks) java.text.DecimalFormatSymbols.DumpDefault12
TEST PASSED (10 checks) java.text.DecimalFormatSymbols.GetSet11
TEST PASSED (3 checks) java.text.DecimalFormatSymbols.GetSet12
TEST PASSED (0 checks) java.text.DecimalFormatSymbols.DumpDefault11
TEST PASSED (1 checks) java.text.DecimalFormatSymbols.getCurrency
TEST PASSED (19 checks) java.text.ChoiceFormat.format
TEST PASSED (2 checks) java.text.ChoiceFormat.next
TEST PASSED (4 checks) java.text.ChoiceFormat.Bad
TEST PASSED (9 checks) java.text.ChoiceFormat.parse
TEST PASSED (40 checks) java.text.BreakIterator.chariter
TEST PASSED (16 checks) java.text.BreakIterator.sentiter
TEST PASSED (62 checks) java.text.BreakIterator.worditer
TEST PASSED (4 checks) java.text.BreakIterator.patho
TEST PASSED (20 checks) java.text.BreakIterator.lineiter
TEST PASSED (7 checks) java.text.Collator.Constants

Failed java.text tests

TEST FAILED: exception when loading java.text.AttributedCharacterIterator.CharItImpl
TEST FAILED: 4 of 12 checks failed java.text.DecimalFormat.digits
TEST FAILED: 2 of 12 checks failed java.text.DecimalFormat.toPattern14
TEST FAILED: 1 of 1 checks failed java.text.DecimalFormat.toLocalizedPattern
TEST FAILED: 2 of 27 checks failed java.text.DecimalFormat.formatExp
TEST FAILED: 6 of 38 checks failed java.text.DecimalFormat.MaximumAndMinimumDigits
TEST FAILED: 1 of 3 checks failed java.text.DecimalFormat.setDecimalFormatSymbols
TEST FAILED: 5 of 90 checks failed java.text.DecimalFormat.format
TEST FAILED: 5 of 16 checks failed java.text.NumberFormat.UK
TEST FAILED: 2 of 53 checks failed java.text.MessageFormat.attribute
TEST FAILED: 3 of 163 checks failed java.text.DateFormatSymbols.PR22851
TEST FAILED: 1 of 8 checks failed java.text.DateFormatSymbols.Test
TEST FAILED: 1 of 15 checks failed java.text.DateFormat.equals
TEST FAILED: 7 of 15 checks failed java.text.RuleBasedCollator.CollatorTests
TEST FAILED: 2 of 2 checks failed java.text.SimpleDateFormat.toLocalizedPattern
TEST FAILED: 5 of 24 checks failed java.text.SimpleDateFormat.parse
TEST FAILED: 2 of 4 checks failed java.text.SimpleDateFormat.applyLocalizedPattern
TEST FAILED: 5 of 15 checks failed java.text.SimpleDateFormat.regress
TEST FAILED: 1 of 7 checks failed java.text.SimpleDateFormat.Localization
TEST FAILED: uncaught exception java.text.DecimalFormatSymbols.serial
TEST FAILED: 1 of 8 checks failed java.text.Collator.GetSet

java.nio: 7/46 tests passed

Passed java.nio tests

TEST PASSED (2 checks) java.nio.ByteBuffer.putDouble
TEST PASSED (4 checks) java.nio.ByteBuffer.direct
TEST PASSED (5 checks) java.nio.ByteBuffer.Order
TEST PASSED (342 checks) java.nio.ByteBuffer.GetPut
TEST PASSED (4 checks) java.nio.ByteBuffer.compact
TEST PASSED (2 checks) java.nio.ByteBuffer.TestAllocateDirect
TEST PASSED (118 checks) java.nio.ByteBuffer.Allocating

Failed java.nio tests

TEST FAILED: exception when loading java.nio.LongBuffer.compact
TEST FAILED: exception when loading java.nio.CharBuffer.CharSequenceWrapper
TEST FAILED: exception when loading java.nio.CharBuffer.compact
TEST FAILED: exception when loading java.nio.FloatBuffer.compareTo
TEST FAILED: exception when loading java.nio.FloatBuffer.compact
TEST FAILED: exception when loading java.nio.charset.Charset.forName2
TEST FAILED: exception when loading java.nio.charset.Charset.forName
TEST FAILED: exception when loading java.nio.charset.Charset.utf16
TEST FAILED: exception when loading java.nio.charset.Charset.canEncode
TEST FAILED: exception when loading java.nio.charset.Charset.UTF8Charset
TEST FAILED: exception when loading java.nio.charset.Charset.encode
TEST FAILED: exception when loading java.nio.ShortBuffer.compact
TEST FAILED: exception when loading java.nio.DoubleBuffer.compareTo
TEST FAILED: exception when loading java.nio.DoubleBuffer.compact
TEST FAILED: exception when loading java.nio.IntBuffer.compareTo
TEST FAILED: exception when loading java.nio.IntBuffer.compact
TEST FAILED: exception when loading java.nio.channels.FileChannel.offsetSingleDirectBuffer
TEST FAILED: exception when loading java.nio.channels.FileChannel.map
TEST FAILED: exception when loading java.nio.channels.FileChannel.multibufferIO
TEST FAILED: exception when loading java.nio.channels.FileChannel.truncate
TEST FAILED: exception when loading java.nio.channels.FileChannel.manyopen
TEST FAILED: exception when loading java.nio.channels.FileChannel.singlebufferIO
TEST FAILED: exception when loading java.nio.channels.FileChannel.lock
TEST FAILED: exception when loading java.nio.channels.FileChannel.multidirectbufferIO
TEST FAILED: exception when loading java.nio.channels.FileChannel.copyIO
TEST FAILED: exception when loading java.nio.channels.FileChannel.offsetSingleBuffer
TEST FAILED: exception when loading java.nio.channels.Selector.testEmptySelect
TEST FAILED: exception when loading java.nio.channels.Channels.ChannelsTest
TEST FAILED: exception when loading java.nio.channels.SocketChannel.select
TEST FAILED: exception when loading java.nio.Buffer.DoubleBufferTest
TEST FAILED: exception when loading java.nio.Buffer.IntBufferTest
TEST FAILED: exception when loading java.nio.Buffer.BufferFactory
TEST FAILED: exception when loading java.nio.Buffer.ByteBufferTest
TEST FAILED: exception when loading java.nio.Buffer.WrappedWithOffsetBufferTest
TEST FAILED: exception when loading java.nio.Buffer.CharBufferTest
TEST FAILED: exception when loading java.nio.Buffer.ShortBufferTest
TEST FAILED: exception when loading java.nio.Buffer.PlainBufferTest
TEST FAILED: exception when loading java.nio.Buffer.FloatBufferTest
TEST FAILED: exception when loading java.nio.Buffer.LongBufferTest

java.math: 19/21 tests passed

Passed java.math tests

 
TEST PASSED (42 checks) java.math.BigDecimal.compareTo
TEST PASSED (164 checks) java.math.BigDecimal.divide
TEST PASSED (4 checks) java.math.BigDecimal.construct
TEST PASSED (21 checks) java.math.BigDecimal.setScale
TEST PASSED (27 checks) java.math.BigInteger.compareTo
TEST PASSED (10 checks) java.math.BigInteger.shift
TEST PASSED (17 checks) java.math.BigInteger.divide
TEST PASSED (2 checks) java.math.BigInteger.setBit
TEST PASSED (29 checks) java.math.BigInteger.modInverse
TEST PASSED (6 checks) java.math.BigInteger.add
TEST PASSED (5 checks) java.math.BigInteger.signum
TEST PASSED (1 checks) java.math.BigInteger.TestOfToByteArray
TEST PASSED (3 checks) java.math.BigInteger.modPow
TEST PASSED (9 checks) java.math.BigInteger.multiply
TEST PASSED (5 checks) java.math.BigInteger.abs
TEST PASSED (33 checks) java.math.BigInteger.equals
TEST PASSED (5 checks) java.math.BigInteger.valueOf
TEST PASSED (3 checks) java.math.BigInteger.toString
TEST PASSED (11 checks) java.math.BigInteger.ctor

Failed java.math tests

TEST FAILED: 6 of 590 checks failed java.math.BigDecimal.DiagBigDecimal
TEST FAILED: 8 of 9 checks failed java.math.BigInteger.TestOfPR27372
TEST FAILED: uncaught exception java.math.BigInteger.serialization

lördag 26 april 2014

Uri's messing with my forks

I'm still stumped on the URI handling. Some mauve tests tries to assert the correctness of the URI and URL, returned by the two methods toURI(), and toURL() of a java.io.File object (where the latter is now deprecated, in favour of the first one). However, the mauve tests cannot be correct, since it for the URI thinks a corect result is the path appended with a file separator, and for the URL result doesn't want the file separator. I.e. in the mauve test, an URI should be "file:ram:t/", and the URL should be "file:ram:t", which is just plain wrong (as corroborated by a simple test on OpenJDK on my mac). If the path points to a directory, it should end with a "/", if it's a file, it should have no ending. So it should in both the URI and URL case be "file:ram:t/".

How to mauve forward

It's very unsettling not being able to rely on the automated tests being correct. So, I'm thinking that I shouldn't give them to much gravitas, but try to get the most obvious errors in JAmiga fixed with the help of Mauve, but not aim for a hundred percent fully successful test run.

Some more URI ranting

GNU classpath has a tendency to add slashes to the end of paths, which denote directories, but doesn't have the ending slash. Like above, the path "ram:t", would become "ram:t/". However, if the path is just "ram:" (being a root directory), it will also get a slash at the end, since GNU classpath doesn't know that colon is a file separator in the amiga world. This leads to the path "ram:/". This is coincidental how Windows does it file URI's, like "C:/" (here normalized from Windows normal backslash notation).

For now i think I'll try and keep it like this, so we might get URI's like "file:ram:/t/tempfile" for our Amiga paths "ram:t/tempfile". Hopefully that will work. Because, like I've on numerous occasions blogged about, the whole URI/file/path-handling is all over the place.

onsdag 23 april 2014

Tests in progress

Mauving forward (have I already used that pun...?)

I'm, as always, continuing my mauve testing. I might just spot stuff, that might make other stuff run.
I've been at this previosuly, but I'm now re-iterating the java-io tests. My progrss so far? See for yourselves:

Passed java.io tests

TEST PASSED (3 checks) java.io.File.ReadMethods
TEST PASSED (3 checks) java.io.File.WriteMethods
TEST PASSED (51 checks) java.io.File.jdk11
TEST PASSED (4 checks) java.io.CharArrayReader.MarkReset
TEST PASSED (4 checks) java.io.CharArrayReader.ProtectedVars
TEST PASSED (1 checks) java.io.CharArrayReader.SimpleRead
TEST PASSED (2 checks) java.io.CharArrayReader.OutOfBounds
TEST PASSED (8 checks) java.io.StringReader.Test
TEST PASSED (5 checks) java.io.FilterInputStream.MarkReset
TEST PASSED (2 checks) java.io.FilterInputStream.SimpleRead
TEST PASSED (2 checks) java.io.PushbackInputStream.ProtectedVars
TEST PASSED (3 checks) java.io.PushbackInputStream.Unread
TEST PASSED (1 checks) java.io.PushbackInputStream.BufferOverflow
TEST PASSED (2 checks) java.io.FileDescriptor.jdk11
TEST PASSED (0 checks) java.io.Serializable.ParentWriteReplace
TEST PASSED (0 checks) java.io.Serializable.ParentReadResolve
TEST PASSED (6 checks) java.io.Writer.Test
TEST PASSED (4 checks) java.io.ObjectStreamClass.ProxyTest
TEST PASSED (4 checks) java.io.SequenceInputStream.Test
TEST PASSED (4 checks) java.io.BufferedInputStream.MarkReset
TEST PASSED (5 checks) java.io.BufferedInputStream.ProtectedVars
TEST PASSED (5 checks) java.io.BufferedInputStream.SimpleRead
TEST PASSED (1 checks) java.io.BufferedInputStream.ZeroRead
TEST PASSED (24 checks) java.io.BufferedInputStream.BigMark
TEST PASSED (2 checks) java.io.BufferedInputStream.Skip
TEST PASSED (10 checks) java.io.OutputStreamWriter.jdk11
TEST PASSED (2 checks) java.io.LineNumberInputStream.Test
TEST PASSED (4 checks) java.io.FilterReader.MarkReset
TEST PASSED (2 checks) java.io.FilterReader.SimpleRead
TEST PASSED (9 checks) java.io.Reader.Test
TEST PASSED (34 checks) java.io.LineNumberReader.Test2
TEST PASSED (120 checks) java.io.LineNumberReader.mark
TEST PASSED (5 checks) java.io.LineNumberReader.Test
TEST PASSED (5 checks) java.io.ByteArrayInputStream.MarkReset
TEST PASSED (4 checks) java.io.ByteArrayInputStream.ProtectedVars
TEST PASSED (1 checks) java.io.ByteArrayInputStream.SimpleRead
TEST PASSED (4 checks) java.io.ObjectOutputStream.useProtocolVersion
TEST PASSED (2 checks) java.io.BufferedReader.MarkReset
TEST PASSED (1 checks) java.io.BufferedReader.SimpleRead
TEST PASSED (19 checks) java.io.BufferedReader.mark
TEST PASSED (5 checks) java.io.BufferedReader.boundary
TEST PASSED (7 checks) java.io.StreamTokenizer.WordWhiteChars
TEST PASSED (11 checks) java.io.StreamTokenizer.newline
TEST PASSED (11 checks) java.io.StreamTokenizer.misc
TEST PASSED (9 checks) java.io.StreamTokenizer.commentchar
TEST PASSED (8 checks) java.io.StreamTokenizer.Test
TEST PASSED (7 checks) java.io.StreamTokenizer.slashstar
TEST PASSED (7 checks) java.io.StreamTokenizer.slashslash
TEST PASSED (1 checks) java.io.InputStreamReader.except
TEST PASSED (52 checks) java.io.InputStreamReader.getEncoding
TEST PASSED (1 checks) java.io.InputStreamReader.hang
TEST PASSED (2 checks) java.io.InputStreamReader.utf8
TEST PASSED (5 checks) java.io.InputStreamReader.jdk11
TEST PASSED (2 checks) java.io.BufferedWriter.Test
TEST PASSED (37 checks) java.io.DataInputStream.readLine
TEST PASSED (3 checks) java.io.FileReader.jdk11
TEST PASSED (4 checks) java.io.PushbackReader.Unread
TEST PASSED (1 checks) java.io.PushbackReader.BufferOverflow
TEST PASSED (4 checks) java.io.PrintWriter.checkError
TEST PASSED (10 checks) java.io.PrintWriter.jdk11
TEST PASSED (3 checks) java.io.InputStream.Test
TEST PASSED (2 checks) java.io.CharArrayWriter.ProtectedVars
TEST PASSED (4 checks) java.io.CharArrayWriter.BasicTests
TEST PASSED (9 checks) java.io.ByteArrayOutputStream.write
TEST PASSED (12 checks) java.io.ByteArrayOutputStream.subclass
TEST PASSED (5 checks) java.io.OutputStream.Test
TEST PASSED (2 checks) java.io.PipedReaderWriter.Test
TEST PASSED (6 checks) java.io.BufferedOutputStream.interrupt
TEST PASSED (2 checks) java.io.BufferedOutputStream.Test
TEST PASSED (1 checks) java.io.PipedStream.receive
TEST PASSED (1 checks) java.io.PipedStream.close
TEST PASSED (3 checks) java.io.PipedStream.Test
TEST PASSED (250 checks) java.io.FilePermission.simple
TEST PASSED (6 checks) java.io.FilterWriter.write
TEST PASSED (5 checks) java.io.StringBufferInputStream.MarkReset
TEST PASSED (3 checks) java.io.StringBufferInputStream.ProtectedVars
TEST PASSED (2 checks) java.io.StringBufferInputStream.SimpleRead
TEST PASSED (2 checks) java.io.FileOutputStream.jdk12
TEST PASSED (3 checks) java.io.StringWriter.Test
TEST PASSED (6 checks) java.io.FilterOutputStream.write
TEST PASSED (2 checks) java.io.PrintStream.encodings
TEST PASSED (1 checks) java.io.PrintStream.subclass
TEST PASSED (2 checks) java.io.Utf8Encoding.ReadReference
TEST PASSED (3 checks) java.io.Utf8Encoding.WriteRead
TEST PASSED (68 checks) java.io.Utf8Encoding.mojo
TEST PASSED (1 checks) java.io.DataOutputStream.writeUTF               

Failed java.io tsts

TEST FAILED: 8 of 14 checks failed java.io.File.listFiles
TEST FAILED: 8 of 14 checks failed java.io.File.list
TEST FAILED: 7 of 19 checks failed java.io.File.canWrite
TEST FAILED: 8 of 15 checks failed java.io.File.emptyFile
TEST FAILED: 17 of 22 checks failed java.io.File.security
TEST FAILED: 1 of 1 checks failed java.io.File.createFile
TEST FAILED: 2 of 4 checks failed java.io.File.URI
TEST FAILED: uncaught exception java.io.File.newFileURI
TEST FAILED: 1 of 3 checks failed java.io.File.ExecuteMethods
TEST FAILED: 1 of 17 checks failed java.io.File.newFile
TEST FAILED: 2 of 4 checks failed java.io.File.UnicodeURI
TEST FAILED: 1 of 1 checks failed java.io.RandomAccessFile.setLength
TEST FAILED: 1 of 2 checks failed java.io.RandomAccessFile.security
TEST FAILED: 2 of 2 checks failed java.io.RandomAccessFile.randomaccessfile
TEST FAILED: 1 of 1 checks failed java.io.RandomAccessFile.jdk11
TEST FAILED: 1 of 1 checks failed java.io.Serializable.BreakMe
TEST FAILED: uncaught exception java.io.Serializable.readResolve
TEST FAILED: 1 of 1 checks failed java.io.Serializable.BreakMeTestSer
TEST FAILED: 1 of 2 checks failed java.io.FileWriter.jdk11
TEST FAILED: uncaught exception java.io.ObjectStreamClass.Test
TEST FAILED: 3 of 3 checks failed java.io.FileInputStream.security
TEST FAILED: 2 of 2 checks failed java.io.FileInputStream.fileinputstream
TEST FAILED: 1 of 2 checks failed java.io.FileInputStream.read
TEST FAILED: uncaught exception java.io.ObjectInputStream.registerValidation
TEST FAILED: uncaught exception java.io.ObjectInputStream.ClassLoaderTest
TEST FAILED: 2 of 3 checks failed java.io.ObjectInputStream.security
TEST FAILED: 1 of 4 checks failed java.io.ObjectInputStream.readResolve
TEST FAILED: uncaught exception java.io.ObjectOutputStream.StreamDataTest
TEST FAILED: 2 of 3 checks failed java.io.ObjectOutputStream.security
TEST FAILED: 1 of 5 checks failed java.io.DataInputStream.ReadReference
TEST FAILED: 1 of 6 checks failed java.io.DataInputStream.ReadReference2
TEST FAILED: 1 of 1 checks failed java.io.ObjectInputOutput.ExtTest
TEST FAILED: uncaught exception java.io.ObjectInputOutput.LoopSerializationTest
TEST FAILED: 2 of 3 checks failed java.io.ObjectInputOutput.Compat2
TEST FAILED: uncaught exception java.io.ObjectInputOutput.HierarchyTest
TEST FAILED: uncaught exception java.io.ObjectInputOutput.OutputTest
TEST FAILED: uncaught exception java.io.ObjectInputOutput.ProxySerializationTest
TEST FAILED: 1 of 1 checks failed java.io.ObjectInputOutput.SerTest
TEST FAILED: 2 of 3 checks failed java.io.ObjectInputOutput.Compat1
TEST FAILED: uncaught exception java.io.ObjectInputOutput.Deserializable
TEST FAILED: 6 of 6 checks failed java.io.ObjectInputOutput.InputTest
TEST FAILED: 12 of 26 checks failed java.io.FilePermission.traversal2
TEST FAILED: 45 of 66 checks failed java.io.FilePermission.traversal
TEST FAILED: 1 of 2 checks failed java.io.FileOutputStream.fileoutputstream
TEST FAILED: 2 of 3 checks failed java.io.FileOutputStream.security
TEST FAILED: 1 of 1 checks failed java.io.FileOutputStream.append
TEST FAILED: 1 of 1 checks failed java.io.FileOutputStream.write
TEST FAILED: 1 of 9 checks failed java.io.DataOutputStream.WriteRead2
TEST FAILED: 1 of 6 checks failed java.io.DataOutputStream.WriteRead              

Conclusion:

86 of 135 test passed.

Looking more closely at the test result, reveals that some native method are missing. But at a even closer look -- are they realy missing?
It turns out that I've just misspelled them; instead of "java.io.ObjectStreamClass", my javaio.librar refers to just "java.io.ObjectStream", missing the "Class" postfix (actually its not per se my misspell, its actually my javah implementation, that must be ignoring the Class ending. So, in the end, still my fault.). With that in place, I just managed to run one of the tests successfully! And I bet you that a few other test cases might be solved by this as well.

Minor update:

These tests now succeeds:

TEST PASSED (14 checks) java.io.ObjectStreamClass.Test
TEST PASSED (27 checks) java.io.RandomAccessFile.jdk11
TEST PASSED (23 checks) java.io.ObjectOutputStream.StreamDataTest
Not as many as I had hoped for, but its something.
Some of the now failing test do however have some more success as they don't throw exceptions.

söndag 23 mars 2014

New address, and new library

The original author of JAmiga, Peter Werno, has kindly redirected jamiga.org to this place. The jamiga2 at blogspot address will still function though. But its nice to know that people will find this new site, instead of the old when googling.

New library and new tool to run

I've previously written about my JGit attempts, and I've finally managed to package it all and get it out of my way. You can download the JGit archive from this site, and the new javalangreflect-library is available via AmiUpdate.

What is it, then?

The new native library is nothing special, it only adds one method I found required by the JGit Command Line Tool. The JGit application is just Eclipse's GIT client. And GIT is used by developers for keeping track of their source code (similar to subversion and CVS). I'm not an experienced GIT user, but I have got it to run, and create some directories. I'm hoping some of you Amiga developers with GIT experience, can help me try it out. There might still be things wrong/missing in JAmiga, which hinders it from fully runnning. I've tried it on my Mac, with much the same result.

So, if you're not a developer, this might not be very fun for you.


If you want to try it out, here are some hints and resources which might help you in using it:
  • First, download my JGit archive. The archive contain the JARs needed together with a small script that simply sets the classpath and starts it. Without arguments you'll get usage help.
  • On Eclipse's own page, you can find instructions on how to use the CLI.

It should be noted that the client is mostly developed to be used by other Java code (in an IDE f.i.), so the CLI tool might be a bit limited.

And I'm not claiming that it works; I'm only saying it can do stuff.

måndag 10 februari 2014

Post-traumatic Jfokus syndrome

So, Jfokus 2014 is over. I mentioned it briefly in my previous blog, but in short it's Sweden's largest Java conference, with roughly 1500 visitors, 6-7 concurrent sessions spanning three days. The speakers come from various places, like Oracle, Red Hat, Spotify, and of course, Omegapoint! My attendance is part of Omegapoint's yearly field trip to this event. I work at Omegapoint, hence my shameless plugs.

Onion to go

My takeaway from Jfokus in terms of JAmiga, I think can be summarized as a real eager in getting OpenJDK to run. There were talks of all snazzy new features OpenJDK 8 has to offer, as well as interesting insights to the general OpenJDK eco-system, and how you can contribute. Mark Reinhold from Oracle talked on Jigsaw project, which basically modularizes Java, and splits the JDK in parts. The objective is primarily to be able to ship a stripped down version of the Java platform, so those who don't for instance use a GUI or a database, can remove those part.

It was described like an onion, where you peel off the outer layers, and in the end you're left with the absolute minimum required. My, perhaps naive, plan is to take the only the core of the onion, and begin my porting efforts on that.

In my last blog I mentioned how I really can't decide on what to focus on. Even more so now. But I really want to get started on the OpenJDK route. And, in order to do that, I think my next move should be to update jamvm to the latest source with OpenJDK support. Now, I know you all amigans really, really want that GUI support. But like I previously wrote, I really don't want to repeat myself and do the same GUI job twice for both GNU Classpath, and OpenJDK -- so, I can either find a way that works for both, or focus on implementing it for OpenJDK. Because seriously, OpenJDK is the only way forward.

The cheese

Within OpenJDK there is a project called Caciocavallo (yeah, I know, cheesy name) that implements AWT GUI stuff, utilizing Swing components. This means that one wouldn't have to implement each AWT component, i.e. map native ReAction/MUI button, textbox, list, and such to its Java counterpart; it'd be sufficient to implement the more general graphics backend, that Swing uses to draw all the gadgets. Now, that doesn't mean that the work is simpler, it just means that a lot of tedious work can be skipped. This also implies that Java GUI's on AmigaOS wouldn't get an Amiga native look, but rather a Java-Swing look. Which of course is boring. But there are ways to implement look-and-feels to make stuff look more native (if I remember correctly in some cases it can actually be native gadgets, and not just a mimiced look).

Well, bla bla bla. I'm getting ahead of myself, to summarize, this is my plan forward:

  • Update jamvm to latest version
  • Build OpenJDK and get to know it better (i.e. build it on linux, and start from there)
  • Take a close look at the Jigsaw project, and peel off all the onion rings
  • See what Caciocavallo can offer
Knowing myself pretty well, I think I'll come back and re-iterate this list. And since jamvm is available in a Git repository, I really should get that Git client running.

måndag 3 februari 2014

Trying to J-focus

Somewhere, over all the place

It feels like I'm all over the place currently. I can't decide what to focus on. I have however managed to implement a new library: javalangreflect.library. I told you about it previously when trying to run the JGit git client. I reached some success, as in "it started".
See output below:

Get git-ing with it

3.Mauve:Projects/jgit/jgit> jamiga:jamvm -Dgnu.classpath.home.url=file:jamiga:classpath org.eclipse.jgit.pgm.Main
jgit --git-dir GIT_DIR --help (-h) --show-stack-trace --version command [ARG ...] The most commonly used commands are: add Add file contents to the index archive zip up files from the named tree branch List, create, or delete branches checkout Checkout a branch to the working tree clone Clone a repository into a new directory commit Record changes to the repository config Get and set repository or global options daemon Export repositories over git:// describe Show the most recent tag that is reachable from a commit diff Show diffs fetch Update remote refs from another repository gc Cleanup unnecessary files and optimize the local repository init Create an empty git repository log View commit history ls-remote List references in a remote repository ls-tree List the contents of a tree object merge Merges two development histories push Update remote repository from local refs reflog Manage reflog information reset Reset current HEAD to the specified state rm Stop tracking a file show display one commit status Show the working tree status tag Create a tag version Display the version of jgit 3.Mauve:Projects/jgit/jgit>

However, trying to get status from a repository only resulted in AmigaDOS requests for disks named "git:". I don't know how its supposed to work, but the Git URI does indeed look like "git://git.berlios.de/jamvm". So I'm not very surprised. I guess I really should try and get the Git client working on another Java system first. So that I know my command line syntax is correct.

Trying to J-focus

This week I'm however really Java focused, as I'm attending Sweden's largest Java conference: Jfokus. Today I listened to stuff on Java 8 and Java 7. Cool stuff indeed! And it makes me really want to go the OpenJDK route, and get us updated, from Java 5 to Java 8. But I also want to get some GUI stuff in order, before I commence a new, I'm fearing long-going route. Furthermore, I really don't want to WET, but rather stay DRY; so I keep telling myself "Don't Repeat Yourself". After my ill-fated Git try (but in some ways successful, I got a new library!), I looked at the GUI code in JAmiga. And in GNU classpath in general. And in OpenJDK. And then I got tired. There are so many classes! And so many native calls!

Gad only knows

Regarding the JAmiga GUI/AWT implementation, it uses GadTools. I would like to use ReAction, since its, a) what OS4 should use, and b) I think its easier to connect it to Java, with it being object oriented. In essence I'm naïvely thinking it'd be sufficient with one native call to the BOOPSI call NewObject. Now, I know that it isn't that easy. But I think its far easier than using GadTool's CreateGadget.

The talented coder Andy, broadblues, Broad, with his phenomenal digital art creating program SketchBlock, has in the accompanying ProAction ARexx GUI creation package, included the source. Which I have peeked at. So, one option is to take inspiration, or even code from that (not without asking though!), and another option could perhaps be to add ARexx support to JAmiga, and get GUI support that way. The last ARexx option is tempting, since it would give me an oportunity to get ARexx to JAmiga, which would be utterly cool. What talks against it, is however speed. It would be a nasty web of intricate Java to native C-code, wrapped in strings sent to ARexx, back to native C-code, doing GUI, back to ARexx, back to native-C, back to Java. And then iterate through that scenario a few times for every little button we want in our GUI. Not something you would like to run big beasts like Eclipse or NetBeans on.

What about MUI, I hear some of you say? Well, I'm not ruling out MUI in any way. Its just that I myself have very limited knowledge of MUI. And I basically want to come up with a solution that works for both OpenJDK and GNU classpath, before I implement it for real. If that solution uses ReAction, it would be easy-peasy to change it to MUI anyways, since they both are BOOPSI.

söndag 12 januari 2014

Mauving forward

I've been running some more Mauve-tests in the java.io package. The tests in java.io are mostly running, beside these:

  • java.io.File.WriteMethods
  • java.io.File.ReadMethods
  • java.io.File.ExecuteMethods
  • --
  • java.io.File.newFileURI
  • java.io.File.WriteMethods
  • java.io.File.URI
  • java.io.File.UnicodeURI
  • --
  • java.io.File.security
  • java.io.RandomAccessFile.security
  • --
  • java.io.File.createFile
  • java.io.File.newFile
  • java.io.File.emptyFile

I've divided them in four section (striked tests are those I've recently fixed).

Protection bits and pieces

The first, Read and Execute methods, are only minor stuff regarding protection bits (i.e. RWED and such). I think it's easily fixed, it might even differ on which Amiga files system I use for the test.

URI, who? Geller?

The second, the URI methods, surround my previous discussed Amiga paths: File me a river, Amiga paths.
So, I'm back struggling with this. To the avail is a nifty class I just found in java.io: PlatformHelper! Reading from the javadoc:

/**
 * We had many changes in File.java, URLStreamHandler.java etc.
 * to handle path representations on different platforms
 * (Windows/Unix-family).
 * Finally we'd like to collect all these ad hoc codes into this
 * utility class.
 *       --Gansha
 */

How convenient.
However, initial tests has got me stumped, as the PlatformHeloper doesn't seem to affect those areas I would have assumed.

URI, where? Bending spoons, eyh?

The third section surrounds security, which gives me exceptions indicated relation to the URI issue in section two:

   java.lang.ExceptionInInitializerError
   at java.lang.SecurityManager.(SecurityManager.java:180)
   at gnu.testlet.TestSecurityManager.(TestSecurityManager.java:132)
   at gnu.testlet.java.io.File.security.test(security.java:94)
   at RunnerProcess.runtest(RunnerProcess.java:379)
   at RunnerProcess.runAndReport(RunnerProcess.java:434)
   at RunnerProcess.main(RunnerProcess.java:242)
java.lang.ExceptionInInitializerError
   at java.lang.SecurityManager.(SecurityManager.java:180)
   at gnu.testlet.TestSecurityManager.(TestSecurityManager.java:132)
   at gnu.testlet.java.io.File.security.test(security.java:94)
   at RunnerProcess.runtest(RunnerProcess.java:379)
   at RunnerProcess.runAndReport(RunnerProcess.java:434)
   at RunnerProcess.main(RunnerProcess.java:242)
Caused by: java.nio.channels.UnresolvedAddressException
   at gnu.java.nio.SocketChannelImpl.connect(SocketChannelImpl.java:162)
   at gnu.java.net.PlainSocketImpl.connect(PlainSocketImpl.java:281)
   at java.net.Socket.connect(Socket.java:463)
   at java.net.Socket.connect(Socket.java:414)
   at gnu.java.net.protocol.ftp.FTPConnection.(FTPConnection.java:255)
   at gnu.java.net.protocol.ftp.FTPConnection.(FTPConnection.java:223)
   at gnu.java.net.protocol.ftp.FTPURLConnection.connect(FTPURLConnection.java:121)
   at gnu.java.net.protocol.ftp.FTPURLConnection.getInputStream(FTPURLConnection.java:165)
   at java.net.URL.openStream(URL.java:737)
   at java.security.Security.loadProviders(Security.java:131)
   at java.security.Security.(Security.java:80)
   at java.lang.SecurityManager.(SecurityManager.java:180)
   ...5 more

Looking at the debug logs of this, indicates that the SecurityManager class wants to open a security file, and it seems to want to resolve this file by using an FTP connection. Even though the file is local. And this most likely is due to the Amiga path from the Java standpoint looks like an URL; "jamiga:foo/bar/security.properties". I've seen a spot where the "foo" can be mistaken for a port number, but silently ignored due to not being a number. Or it might be somewhere else. Investigation is on-going.

Uri, hurry up!

The fourth section, or rather the createFile-test fails because it takes too long to complete. It might be due to that it truly takes too long, or it might be some other error that causes it to take too long. Only time will tell, I guess.

Coming attractions

Other that Mauve-testing, I'm trying to do a follow-up on the previously released developer's kit. But those tries are hindered by the issues just mentioned.

söndag 5 januari 2014

Are you having trouble installing JAmiga 1.2?

From reports on the support forum on amigans.net, JosDuchIt reported some troubles installing and running JAmiga. The culprit was an innocent space in the name of the driver where JAmiga was installed.

I'm ashamed to say that my installation script didn't support spaces in partition or drawer of installation path. I myself have had spaces in my partition names, f.i. "AmigaOS 4:", so its a bit silly i didn't catch this. I'm assuming other's have had similar problems, but only JosDuchIt had the courage, and sense to report it!

Given the Amiga community's size, its really crucial for developers to get some sort of user feedback. I'm actually pretty spoiled with a rather large buzz, all things considering. So, its not so much for JAmiga's users, but more for the sake of all the other program on os4depot and elsewhere: please, if you download something and it doesn't work - report it. Most, if not all, developers want user feedback, because they put a great deal of effort into just uploading stuff to os4depot.

I'm really throwing bricks in my own glass house, but its one of my new years resolutions: to give more feedback for programs I regularly use.

Updated installer available

Anyway, the error with the installer has now been fixed, and the JAmiga 1.2 archive on os4depot should be able to install nicely - even with spaces. Remember to AmiUpdate after installation!

Some background info

I thought I'd share some of my installations script behavior. It is in most regards a pretty normal install script. Howver, the Java classes (i.e. all the class files building up the Java SE standard), are in-fact bundled in the JAmiga archive as lha archives. The entire Java SE standard consist of roughly 3700 classes, and in essence the same amount of files. So I wanted to lessen the initial unpacking to a minimum, and leave the most unpacking to the install script. Therefor UnArc handles the unpacking during installation. And I missed a pair of quotes surrounding the destination drawer, hence the space issue.

Other things I've included in the install script are the preview and choice of icons. For this I use Multiview with its companioning ARexx port to close the preview.

In order to open the DefIcons tutorial, I use the AmigaOS 4 standard program "URLOpen". One future enhancement I'm thinking of is to automatically launch AmiUpdate when the installation has been performed, so any new updates have a better chance of being noticed and installed.

And these are some of my favorite things with version 4 of AmigaOS. As a developer I can actually rely on a few things being installed by default. I don't need to weigh down my archive with support files. Now, I wasn't much of a developer in the 3.x era, but I remember installing stuff often required the installer to supply the lha unarchiver and such. Furthermore, with the power of ARexx, a lot of stuff can be done from scripts, which I'm just realizing writing a few AmigaGuides for JAmiga.

Anyhow, I should get back to writing and releasing my Twitter application. Not because its ground breaking or earth shattering in any way, its only because it is a great example of what can be done with JAmiga today, using third party JAR files.

Tata!

söndag 29 december 2013

Java Developer's Kit

Tiny update for Java developer's

On the JAmiga support forum on amigans.net I've added a little note on a developer's package available on AmiUpdate:

On AmiUpdate you can find an update consisting of a few developer's files. There's a new Java compiler, a simple example, as well as documentation.

Just update your system, go to JAmiga:Documents/Developer.guide, and you're just minutes away from compiling your own applications.

I'll try to add more info on how you can use it with various third-party jar files.

New year's resolution?

I managed to get this tiny update out before the year has ended. Next year, I'll try to be better in getting stuff out there. Even it's only small things. I've been a bit too silent the last two months, but other things in life has taken up my time.

Over and out. And a happy new year!

måndag 4 november 2013

JAmiga 1.2

JAmiga 1.2 is currently in os4depot's upload queue. After its been approved and uploaded, I will add the update to AmiUpdate -- so you who already have v 1.1 installed can wait for the AmiUpdate update.

This is a full release: all required components are in the archive. Future updates of the individual components will be available with AmiUpdate as usual.

Change log

  • Added support for java.io.Console in javanio.library
  • Changed drawer hierarchy of JAmiga files in order to ease update and maintainability
  • Minor fixes in jamvm
  • New default and regular icons from Mason
  • The environmental variables (BOOTCLASSPATH and LD_LIBRARY_PATH) are no longer needed

Thanks to all of you

I'd like to, in no particular order, thank you all who have contributed in any way to JAmiga. To mention a few:

  • Joel Edberg for testing (and constant nagging me for updates)
  • Thomas Blatt for the first set of icons
  • Martin Mason Merz for the 2nd set of icons, including DefIcons
  • All you kind lovely amigans for support, cheering and donations! Without you, my work would be profoundly pointless!

And, of course, credit where credit is due. This is a continuation of the original JAmiga effort, by Peter Werno and André Dörffler. Even though there has been lots of changes, and it now also sports the JamVm JVM by Robert Lougher.

Nope, now I have to press "Publish" -- the os4depot upload has been approved!

torsdag 17 oktober 2013

Continuing mauve testing

Slowly but surely I'm working through the mauve suite. Currently, focus is on java.io.
Yesterday I got these fails:
FAIL: java.io.File.ReadMethods
FAIL: java.io.File.ExecuteMethods
FAIL: java.io.File.newFileURI
FAIL: java.io.File.WriteMethods
FAIL: java.io.File.URI
FAIL: java.io.File.security
FAIL: java.io.File.UnicodeURI
FAIL: java.io.File.createFile
FAIL: java.io.File.newFile
FAIL: java.io.File.emptyFile
FAIL: java.io.RandomAccessFile.security
After running these tests:
gnu.testlet.java.io.File.canWrite
gnu.testlet.java.io.File.ReadMethods
gnu.testlet.java.io.File.ExecuteMethods
gnu.testlet.java.io.File.newFileURI
gnu.testlet.java.io.File.WriteMethods
gnu.testlet.java.io.File.URI
gnu.testlet.java.io.File.security
gnu.testlet.java.io.File.list
gnu.testlet.java.io.File.listFiles
gnu.testlet.java.io.File.UnicodeURI
gnu.testlet.java.io.File.createFile
gnu.testlet.java.io.File.newFile
gnu.testlet.java.io.File.jdk11
gnu.testlet.java.io.File.emptyFile
gnu.testlet.java.io.CharArrayReader.OutOfBounds
gnu.testlet.java.io.CharArrayReader.MarkReset
gnu.testlet.java.io.CharArrayReader.ProtectedVars
gnu.testlet.java.io.CharArrayReader.SimpleRead
gnu.testlet.java.io.StringReader.Test
gnu.testlet.java.io.FilterInputStream.MarkReset
gnu.testlet.java.io.FilterInputStream.SimpleRead
gnu.testlet.java.io.RandomAccessFile.security
gnu.testlet.java.io.RandomAccessFile.randomaccessfile
gnu.testlet.java.io.RandomAccessFile.jdk11
gnu.testlet.java.io.RandomAccessFile.setLength
gnu.testlet.java.io.PushbackInputStream.Unread
gnu.testlet.java.io.PushbackInputStream.ProtectedVars
gnu.testlet.java.io.PushbackInputStream.BufferOverflow
gnu.testlet.java.io.FileDescriptor.jdk11
gnu.testlet.java.io.Serializable.ParentReadResolve
gnu.testlet.java.io.Serializable.readResolve
gnu.testlet.java.io.Serializable.ParentWriteReplace
gnu.testlet.java.io.Serializable.MySerializable
gnu.testlet.java.io.Serializable.BreakMe
gnu.testlet.java.io.Serializable.MyBreakMe
gnu.testlet.java.io.Serializable.BreakMeTestSer
gnu.testlet.java.io.FileWriter.jdk11
gnu.testlet.java.io.Writer.Test
gnu.testlet.java.io.ObjectStreamClass.DefinedNotStatic
gnu.testlet.java.io.ObjectStreamClass.DefinedNotFinal
gnu.testlet.java.io.ObjectStreamClass.Test
gnu.testlet.java.io.ObjectStreamClass.NotSerial
gnu.testlet.java.io.ObjectStreamClass.Serial
gnu.testlet.java.io.ObjectStreamClass.C
gnu.testlet.java.io.ObjectStreamClass.A
gnu.testlet.java.io.ObjectStreamClass.B
gnu.testlet.java.io.ObjectStreamClass.ProxyTest
gnu.testlet.java.io.ObjectStreamClass.Defined
gnu.testlet.java.io.SequenceInputStream.Test
gnu.testlet.java.io.FileInputStream.security
gnu.testlet.java.io.FileInputStream.fileinputstream
gnu.testlet.java.io.FileInputStream.read
gnu.testlet.java.io.BufferedInputStream.ZeroRead
gnu.testlet.java.io.BufferedInputStream.MarkReset
gnu.testlet.java.io.BufferedInputStream.Skip
gnu.testlet.java.io.BufferedInputStream.BigMark
gnu.testlet.java.io.BufferedInputStream.ProtectedVars
gnu.testlet.java.io.BufferedInputStream.SimpleRead
gnu.testlet.java.io.OutputStreamWriter.jdk11
gnu.testlet.java.io.LineNumberInputStream.Test
gnu.testlet.java.io.FilterReader.MarkReset
gnu.testlet.java.io.FilterReader.SimpleRead
gnu.testlet.java.io.Reader.Test
gnu.testlet.java.io.ObjectInputStream.registerValidation
gnu.testlet.java.io.ObjectInputStream.readResolve
gnu.testlet.java.io.ObjectInputStream.ReadResolveHelper
gnu.testlet.java.io.ObjectInputStream.security
gnu.testlet.java.io.ObjectInputStream.TestObjectInputValidation
gnu.testlet.java.io.ObjectInputStream.ClassLoaderTest
gnu.testlet.java.io.LineNumberReader.Test
gnu.testlet.java.io.LineNumberReader.mark
gnu.testlet.java.io.LineNumberReader.Test2
gnu.testlet.java.io.ByteArrayInputStream.MarkReset
gnu.testlet.java.io.ByteArrayInputStream.ProtectedVars
gnu.testlet.java.io.ByteArrayInputStream.SimpleRead
gnu.testlet.java.io.ObjectOutputStream.StreamDataTest
gnu.testlet.java.io.ObjectOutputStream.useProtocolVersion
gnu.testlet.java.io.ObjectOutputStream.security
gnu.testlet.java.io.BufferedReader.boundary
gnu.testlet.java.io.BufferedReader.MarkReset
gnu.testlet.java.io.BufferedReader.mark
gnu.testlet.java.io.BufferedReader.SimpleRead
gnu.testlet.java.io.StreamTokenizer.commentchar
gnu.testlet.java.io.StreamTokenizer.misc
gnu.testlet.java.io.StreamTokenizer.newline
gnu.testlet.java.io.StreamTokenizer.WordWhiteChars
gnu.testlet.java.io.StreamTokenizer.Test
gnu.testlet.java.io.StreamTokenizer.slashslash
gnu.testlet.java.io.StreamTokenizer.slashstar
gnu.testlet.java.io.InputStreamReader.hang
gnu.testlet.java.io.InputStreamReader.utf8
gnu.testlet.java.io.InputStreamReader.getEncoding
gnu.testlet.java.io.InputStreamReader.jdk11
gnu.testlet.java.io.InputStreamReader.except
gnu.testlet.java.io.BufferedWriter.Test
gnu.testlet.java.io.DataInputStream.readLine
gnu.testlet.java.io.DataInputStream.ReadStream2
gnu.testlet.java.io.DataInputStream.ReadReference
gnu.testlet.java.io.DataInputStream.ReadStream
gnu.testlet.java.io.DataInputStream.ReadReference2
gnu.testlet.java.io.FileReader.jdk11
gnu.testlet.java.io.PushbackReader.Unread
gnu.testlet.java.io.PushbackReader.BufferOverflow
gnu.testlet.java.io.PrintWriter.checkError
gnu.testlet.java.io.PrintWriter.jdk11
gnu.testlet.java.io.InputStream.Test
gnu.testlet.java.io.CharArrayWriter.BasicTests
gnu.testlet.java.io.CharArrayWriter.ProtectedVars
gnu.testlet.java.io.ByteArrayOutputStream.subclass
gnu.testlet.java.io.ByteArrayOutputStream.write
gnu.testlet.java.io.OutputStream.Test
gnu.testlet.java.io.PipedReaderWriter.Test
gnu.testlet.java.io.PipedReaderWriter.PipedTestWriter
gnu.testlet.java.io.ObjectInputOutput.OutputTest
gnu.testlet.java.io.ObjectInputOutput.LoopSerializationTest
gnu.testlet.java.io.ObjectInputOutput.SerTest
gnu.testlet.java.io.ObjectInputOutput.Compat2
gnu.testlet.java.io.ObjectInputOutput.Compat1
gnu.testlet.java.io.ObjectInputOutput.Test
gnu.testlet.java.io.ObjectInputOutput.Deserializable
gnu.testlet.java.io.ObjectInputOutput.SerBase
gnu.testlet.java.io.ObjectInputOutput.SerializableLoopB
gnu.testlet.java.io.ObjectInputOutput.ProxySerializationTest
gnu.testlet.java.io.ObjectInputOutput.InputTest
gnu.testlet.java.io.ObjectInputOutput.SerializableLoopA
gnu.testlet.java.io.ObjectInputOutput.ExtTest
gnu.testlet.java.io.ObjectInputOutput.HierarchyTest
gnu.testlet.java.io.BufferedOutputStream.Test
gnu.testlet.java.io.BufferedOutputStream.helper
gnu.testlet.java.io.BufferedOutputStream.interrupt
gnu.testlet.java.io.PipedStream.PipedStreamTestWriter
gnu.testlet.java.io.PipedStream.receive
gnu.testlet.java.io.PipedStream.Test
gnu.testlet.java.io.PipedStream.close
gnu.testlet.java.io.FilePermission.simple
gnu.testlet.java.io.FilePermission.traversal2
gnu.testlet.java.io.FilePermission.traversal
gnu.testlet.java.io.FilterWriter.MyFilterWriter
gnu.testlet.java.io.FilterWriter.write
gnu.testlet.java.io.StringBufferInputStream.MarkReset
gnu.testlet.java.io.StringBufferInputStream.ProtectedVars
gnu.testlet.java.io.StringBufferInputStream.SimpleRead
gnu.testlet.java.io.FileOutputStream.append
gnu.testlet.java.io.FileOutputStream.fileoutputstream
gnu.testlet.java.io.FileOutputStream.security
gnu.testlet.java.io.FileOutputStream.write
gnu.testlet.java.io.FileOutputStream.jdk12
gnu.testlet.java.io.StringWriter.Test
gnu.testlet.java.io.FilterOutputStream.write
gnu.testlet.java.io.PrintStream.subclass
gnu.testlet.java.io.PrintStream.encodings
gnu.testlet.java.io.Utf8Encoding.WriteRead
gnu.testlet.java.io.Utf8Encoding.mojo
gnu.testlet.java.io.Utf8Encoding.ReadReference
gnu.testlet.java.io.DataOutputStream.writeUTF
gnu.testlet.java.io.DataOutputStream.WriteRead2
gnu.testlet.java.io.DataOutputStream.WriteRead
And, tonight I fixed these issues:

java.io.File.ReadMethods
java.io.File.ExecuteMethods
java.io.File.WriteMethods
So, slowly, but surely. Even though most of these errors aren't show stoppers, they still need to be fixed.

söndag 29 september 2013

File me a river

I finally found what was wrong, and why ECJ couldn't compile like it should. I missed my modifications made to jva.io.VMFile, the native layer between Java files and Amiga files. With this in place, ECJ can now compile correctly. So, no more need to use jikes.

Connecting the dots

However, the file handling is not entirely solved just yet. I'm still pondering on how to solve the dot file, ".", denoting the current directory. I think it's a rather silly little marker; to me as an amigan it serves no real purpose. It just sits there. On unix, a path like "/dev/./././" is really just "/dev/". So, I don't really see the point (pun intended).

Picture stolen from bigactivities.com

Anyhow, I think I have to handle it somehow, since there'll probably be a few applications assuming that it works (amongst them jamvm). The "/dev/" example also leads me to one such unix-amiga inconsistency. In the mauve test suite, a test exists involving files and URI's. The test wants the URI of file "/dev/tmp" to be just "/dev/tmp" (or rather the URI "file://dev/tmp"), whereas the current JAmiga implementation happily tries to make that into "file://SYS:System//dev/tmp/", when I guess it really should be just "file://dev/tmp/" (internally represented as "dev:tmp/"). And where AmigaDOS thinks the path "SYS:System//Utilities", really is "SYS:Utilities", JAmiga thinks its just "SYS:System/Utilities".

Annoying.

måndag 26 augusti 2013

Whose line is it anyway?

Its been a while since an update. I've however not been entirely idle. I've updated to the latest GNU Classpath CVS version, which only added the java.io.Console class. But I found the Console class to be needed by the egit Git Hub client. Sadly, egit also requires some annotation stuff found in the not yet implemented "javalangreflect" library. Its a library with only one method in it, so it shouldn't be a biggie. Its just a matter of, well, doing it.

Commas and colons

Furthermore, I've been looking at running the Eclipse Java Compiler, ECJ. Now, don't get your hopes up on the Eclipse mentioning -- its only the compiler, no GUI stuff. But it can compile new Java source, i.e. generics and stuff, and is not limited to Java 1.4, like the old Jikes. However, with my move to the latest GNU Classpath (and some other organizational changes), ECJ won't compile things correctly.

This either due to something not being correctly configured in the new Classpath, or due to the classpath misbehaving. In order to work, Java needs to know where to find all the Java classes. Usually you can set this using the ENV variable CLASSPATH. In order to set a list of directories to search for classes, you use some sort of delimiter between the directories. In JAmiga this is comma.

CLASSPATH=JAmiga:jvm/classes,Work:classpath,
A classpath with two (actually three) directories to search for classes.

The GNU Classpath and jamvm are (or were), like everything else, mostly Unix/Linux and Windows oriented. They use either colon, or semicolon to separate classpath directories, for Unix/Linux and Windows respectively. Now, Amiga's device separator is colon, so colon can't be used. Semicolon could be used... but the way GNU Classpath and jamvm detects that a system is f.i. Windows, is based on the simple occurrence of a colon, sometimes a backslash, and sometimes the fact that it doesn't seem to be a Unix path at all. So using semicolon would sometimes suggest a Windows system (and, inherently, only allowing device names consisting of one character like in C:). Therefor I thought it better to simply "invent" a new standard, using comma. To make matters worse, sometimes files are referenced using an URI, meaning we have even more colons, like "file:Work:classpath/", or "file://Work:classpath/". More often than seldom, I see lines like "file:JAmiga:jvm/classes/Work:classpath/" being interpreted as one directory. Its a mess, really.

The dotted line

I don't know if the whole classpath-colon-slash-backslash mess, is the real culprit to ECJ not running. There are also known issues with the "dot" device, i.e. the current directory marker. The CLASSPATH ENV variable usually ends with a dot, so that the current directory is included in the search. Using f.i. "JAmiga:classpath,Work:other/classes,." should include three directories in Java's class search. However, in the Amiga world, this doesn't work, since the dot does nothing special in the Amiga OS (its just a non-existing file). A possible workaround for AmigaOS 4 would be "JAmiga:classpath,Work:other/classes,CURRDIR:". However, that will actually search for stuff in "CURRDIR:/", which is nothing else than the parent directory of CURRDIR -- if you know your Amiga DOS, you'll know that the last slash is what Windows and Unix calls "..", i.e. the parent directory. And this last slash is added on a line nestled in various for loops looking for slashes and colons, trying to both determine Windows- or unixness, as well as formatting the path correctly. And after a hard day's work... for loops and slashes really becomes a jungle.

Trying to find whose line it is... usually only makes me waste hours on youtube looking at stuff like this:

Whose line can really consume hours.